package _binary_search;

/**
 * 278. 第一个错误的版本
 */
public class No278 {
    public int firstBadVersion(int n) {
        int left = 1, right = n;
        while (left <= right) {
            int mid = left + (right - left) / 2;
            boolean badVersion = isBadVersion(mid);
            if (!badVersion) left = mid + 1;
            else right = mid - 1;
        }
        return left;
    }

    private boolean isBadVersion(int mid) {
        return false;
    }
}
